<script setup lang="ts">
definePageMeta({
  layout: 'advise',
  title: '建议',
  i18n: 'menu.advise',
})
const { t } = useI18n();
const desc = ref('');
const onSubmit = (values: any) => {
  console.log('submit', values);
};
const buttonType = computed(() => desc.value.length ? 'primary' : 'default');
</script>

<template>
  <div mx-auto text-16 text-dark dark:text-white>
    <van-form @submit="onSubmit" required="auto">
      <div class="mb-10 ">{{t("my_page.advise.desc")}}<span class="color-red">*</span></div>
      <van-cell-group inset>
        <van-field label-align="top" v-model="desc" name="desc" type="textarea" rows="6" autosize maxlength="200"
          show-word-limit :placeholder="t('my_page.advise.placeDesc')" :rules="[{ required: true, message: t('my_page.advise.placeReply') }]" />
      </van-cell-group>
      <div class="mt-16">
        <van-button block :type="buttonType" native-type="submit">
          {{t('common.submit')}}
        </van-button>
      </div>
    </van-form>
  </div>
</template>
